/**
 * @file activity.h
 *
 */
#ifndef ACTIVITY_H
#define ACTIVITY_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_ACTIVITY != 0

/*********************
 *      DEFINES
 *********************/
#define ACTIVITY_TILE_COUNT  6
#define ACTIVITY_STR_LENGTH  32

/**********************
 *      TYPEDEFS
 **********************/
typedef void (*activity_tile_create_func)(uint8_t);

typedef struct {
    uint16_t title_txt_id;
    const void * title_img_src;
    char label1_txt[ACTIVITY_STR_LENGTH];
    char label2_txt[ACTIVITY_STR_LENGTH];
    uint32_t value_goal;
    uint32_t value_today;
    uint32_t value_wday[ACTIVITY_WDAY_CNT];
    lv_point_t base_line_points[2];
    lv_point_t goal_line_points[2];
    lv_point_t value_line_points[ACTIVITY_WDAY_CNT][2];
    lv_color_t value_line_color;
} tile_common_desc_t;

typedef struct {
    lv_watch_obj_ext_t lv_watch_obj;

    lv_obj_t * tileview;
    lv_obj_t * tile_summary_cont;
    lv_obj_t * tile_calorie_cont;
    lv_obj_t * tile_distribution_cont;
    lv_obj_t * tile_steps_cont;
    lv_obj_t * tile_strength_cont;
    lv_obj_t * tile_hours_cont;
    tile_common_desc_t tile_desc[3];  //for steps, strength, hours
    hal_rtc_t rtc_time;
} lv_activity_ext_t;

/**********************
 * GLOBAL PROTOTYPES
 **********************/
void activity_create_event_cb(lv_obj_t * btn, lv_event_t e);
#if USE_LV_WATCH_LAUNCHER2 != 0
void sport_create_tab(lv_obj_t * par);
#endif
/**********************
 *      MACROS
 **********************/

#endif /*USE_LV_WATCH_ACTIVITY*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*ACTIVITY_H*/
